package item;

import mobile.Mobile;


public class Item 
{
	private int iDamage;
	private int iAc;
	private int iSlot; 
	/*
	 * 	0	: none
	 *	1	: right hand
	 *	2	: left hand
	 *	3	: both hands
	 *	4	: helmet
	 * 	5	: body
	 *	6	: hands
	 *	7	: legs
	 *	8	: feet
	 *	9	: wrists
	 *	10	: ring 1
	 *	11	: ring 2
	 *	12	: special, firehorn, etc
	 */
	private int iEquipped; // what slot, or 0 for not equiped
	private int iNotUsableBy;	
	private String iName;
	private int iType;
	/*
	 *	0	: none
	 *	1	: weapon
	 *	2	: armour
	 */
	private int iAreaDamage;
	/*
	 *	0	: none
	 *	1	: one group
	 *	2	: all groups
	 */
	private int iRange; // range 0, (mele) to 90 (max)
	private int iCharges; // -1 = none, 0 = empty
	private int iChargesMax; // max charges, 0 for not rechargable

	private int iDamageType;
	/* damage types
	 * 	0	: slashing
	 *  1	: piercing
	 *  2	: blunt
	 *  4	: fire
	 *  8	: ice
	 *  16	: wind
	 *  32	: earth
	 *  64	: magic
	 */
	private int iAttackBonus;
	private int iAcBonus;
 
	

	public Item( String name, int type, int damage, int slot )
	{
		iName=name;
		iType=type;
		iDamage=damage;
		iEquipped=0;
		iSlot=slot;
		iCharges=-1;
		iChargesMax=0;
		iRange=0;	
		iAc=0;
		iAcBonus=0;
		iDamageType=0;
		iAttackBonus=0;
	}

	public void printStatus ()
	{
		System.out.println("Name: " + iName);
		System.out.println("Type: " + iType);
		System.out.println("Damage: " + iDamage);
		System.out.println("Ac: " + iAc);
		System.out.println("AcBonus: " + iAcBonus);
		System.out.println("AttackBonus: " + iAttackBonus);
		System.out.println("Damage type: " + iDamageType);
		System.out.println("Range: " + iRange);
		System.out.println("Charges: " + iCharges);
		System.out.println("Charges max: " + iChargesMax);
		System.out.println("Slot: " + iSlot);
		
	}

	/* TODO: functions for special attacks
	 * functions for special attacks (ex, firehorn), 
	 * functions for special defence, armour spells, healing, summoning,
	 * 	teleporation, etc
	 */


	public void setName(String newName)
	{
		iName=newName;
	}

	public String getName()
	{
		return iName;
	}
	//	can we use this object?
	// 1 = we can, 0 = no we can not.
	public int equipAccess( Mobile me)
	{
		// TODO: check for things..

		return 1;
	}
	public int getEquipped()
	{
		return iEquipped;
	}

	public int equip()
	{
		iEquipped=iSlot;
		
		return iSlot;
	}		

	public int unEquip()
	{	
		iEquipped=0;
		return iEquipped;
	}

	public int getSlot()
	{
		return iSlot;
	}

	public int getDamage()
	{
		return iDamage;
	}

	public int getAc()
	{
		return iAc;
	}

	public int getAreaDamage()
	{
		return iAreaDamage;
	}


	public int getNotUsableBy() {
		return iNotUsableBy;
	}


	public void setNotUsableBy(int notUsableBy) {
		iNotUsableBy = notUsableBy;
	}


	public int getType() {
		return iType;
	}


	public void setIType(int type) {
		iType = type;
	}


	public int getRange() {
		return iRange;
	}


	public void setRange(int range) {
		iRange = range;
	}


	public int getICharges() {
		return iCharges;
	}


	public void setICharges(int charges) {
		iCharges = charges;
	}


	public int getChargesMax() {
		return iChargesMax;
	}


	public void setChargesMax(int chargesMax) {
		iChargesMax = chargesMax;
	}


	public int getDamageType() {
		return iDamageType;
	}


	public void setDamageType(int damageType) {
		iDamageType = damageType;
	}


	public int getAttackBonus() {
		return iAttackBonus;
	}


	public void setAttackBonus(int attackBonus) {
		iAttackBonus = attackBonus;
	}
	
	public int getAcBonus()
	{
		return iAcBonus;
	}


}




